1. Field of the Invention
The invention relates to an image processing method and apparatus, more particularly to a method and apparatus for uniformly scaling a digital image.
2. Description of the Related Art
The ability to combine digital images is of utmost importance in computer multi-media applications. Usually, a digital image is preprocessed before it can be combined with another digital image. Preprocessing is normally accomplished by increasing the size of the digital image (hereinafter referred to as scaling-up), reducing the size of the digital image (hereinafter referred to as scaling-down), cutting a selected portion of the digital image, shifting the selected portion of the digital image to another location, etc.
Scaling-up and scaling-down of digital images are usually accomplished by a specially-programmed computer. Scaling-up is achieved by performing linear interpolation of every two scan lines of the digital image to obtain at least one interpolated scan line that is inserted therebetween, and by performing linear interpolation of every two pixel data of each scan line to obtain at least one interpolated pixel data that is inserted therebetween. Scaling-down is achieved by deleting some of the scan lines of the digital image, and by deleting some of the pixel data of each of the retained scan lines.
In the scaling-up of digital images, linear interpolation of original image data by the computer is relatively slow. Thus, various dedicated hardware devices, such as those disclosed in European Patent Publication No. 0079542A2 and British Patent Publication No. GB2226471A, have been developed to permit real-time scaling-up of digital images.
One of the drawbacks of these dedicated hardware devices is that they are only capable of scaling-up digital images to a limited extent. When scaling-up a digital image with (N) scan lines, the total number of scan lines to be interpolated must be a multiple of (N-1) so as to permit insertion of an equal number of interpolated scan lines between every two of the original scan lines of the original digital image in order to maintain uniformity. The same is true when scaling-up a scan line with (N') pixel data. Thus, the conventional scaling-up apparatus is incapable of uniformly scaling a digital image with (N) scan lines (or (N') pixel data per scan line) if the total number of interpolated scan lines (or interpolated pixel data per scan line) is not a multiple of (N-1) (or (N'-1)). In addition, the conventional scaling-up apparatus is only capable of scaling-up a digital image in both the horizontal and vertical directions, and is incapable of scaling-down a digital image in any of the horizontal and vertical directions.